/*
 * DetalhesAtendimento.java
 *
 * Created on 08/04/2011, 21:39:43
 */

package pbf.dialog;

import pbf.conf.hibernate.entidades.Atendimento;
import pbf.conf.hibernate.entidades.DescricaoDoAtendimento;
import pbf.conf.hibernate.entidades.StatusAtendimento;
import pbf.util.DataHora;

/**
 *
 * @author Ricardo
 */
public class DetalhesAtendimento extends javax.swing.JDialog
{
    public DetalhesAtendimento(java.awt.Frame parent, boolean modal)
    {
        super(parent, modal);
        initComponents();
    }

    public void setFormulario(Atendimento atendimento,DescricaoDoAtendimento descricao, StatusAtendimento status)
    {
        atendimentoComentario.setText(atendimento.getAtendimentoComentario());
        atendimentoDtAtendimento.setText(DataHora.getData(atendimento.getAtendimentoDtAtendimento()));
        atendimentoId.setText(""+atendimento.getAtendimentoId());
        dtDescrição.setText(descricao.getDtDescricao());
        stStatus.setText(status.getStStatus());
        setVisible(true);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        atendimentoComentario = new javax.swing.JTextArea();
        jLabel15 = new javax.swing.JLabel();
        stStatus = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jSeparator9 = new javax.swing.JSeparator();
        atendimentoId = new javax.swing.JTextField();
        atendimentoDtAtendimento = new javax.swing.JTextField();
        dtDescrição = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jSeparator11 = new javax.swing.JSeparator();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(null);

        atendimentoComentario.setColumns(20);
        atendimentoComentario.setEditable(false);
        atendimentoComentario.setRows(5);
        jScrollPane1.setViewportView(atendimentoComentario);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(20, 190, 450, 110);

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel15.setText("Comentário:");
        getContentPane().add(jLabel15);
        jLabel15.setBounds(20, 170, 130, 20);

        stStatus.setEditable(false);
        stStatus.setFont(new java.awt.Font("Tahoma", 0, 14));
        getContentPane().add(stStatus);
        stStatus.setBounds(150, 140, 320, 23);

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel16.setText("Código:");
        getContentPane().add(jLabel16);
        jLabel16.setBounds(20, 50, 130, 20);

        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel17.setText("Data:");
        getContentPane().add(jLabel17);
        jLabel17.setBounds(20, 80, 130, 20);

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 16));
        jLabel4.setText("Descrição do Atendimento");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(20, 20, 290, 20);
        getContentPane().add(jSeparator9);
        jSeparator9.setBounds(20, 40, 450, 10);

        atendimentoId.setEditable(false);
        atendimentoId.setFont(new java.awt.Font("Tahoma", 0, 14));
        getContentPane().add(atendimentoId);
        atendimentoId.setBounds(150, 50, 320, 23);

        atendimentoDtAtendimento.setEditable(false);
        atendimentoDtAtendimento.setFont(new java.awt.Font("Tahoma", 0, 14));
        getContentPane().add(atendimentoDtAtendimento);
        atendimentoDtAtendimento.setBounds(150, 80, 320, 23);

        dtDescrição.setEditable(false);
        dtDescrição.setFont(new java.awt.Font("Tahoma", 0, 14));
        getContentPane().add(dtDescrição);
        dtDescrição.setBounds(150, 110, 320, 23);

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel18.setText("Descrição:");
        getContentPane().add(jLabel18);
        jLabel18.setBounds(20, 110, 130, 20);

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel19.setText("Status:");
        getContentPane().add(jLabel19);
        jLabel19.setBounds(20, 140, 130, 20);
        getContentPane().add(jSeparator11);
        jSeparator11.setBounds(0, 310, 550, 10);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pbf/imagens/cross-circle.png"))); // NOI18N
        jButton1.setText("Fechar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(363, 320, 110, 25);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-500)/2, (screenSize.height-388)/2, 500, 388);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    setVisible(false);
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                DetalhesAtendimento dialog = new DetalhesAtendimento(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea atendimentoComentario;
    private javax.swing.JTextField atendimentoDtAtendimento;
    private javax.swing.JTextField atendimentoId;
    private javax.swing.JTextField dtDescrição;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator11;
    private javax.swing.JSeparator jSeparator9;
    private javax.swing.JTextField stStatus;
    // End of variables declaration//GEN-END:variables

}
